package com.mvp.shq.washer.ui.userCenter;

import com.mvp.shq.washer.entity.BaseResult;
import com.mvp.shq.washer.http.Api;
import com.mvp.shq.washer.http.RxSchedulers;

import java.util.Date;

import io.reactivex.Observable;
import okhttp3.RequestBody;

/**
 * Created by Administrator on 2017/8/24.
 */

public class UserCenterModel implements UserCenterConstract.Model {
    @Override
    public Observable<BaseResult<String>> updateBirthday(String token, String userId, String birthday) {
        return Api.getInstance().service
                .updateBirthday(token,userId,birthday)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<String>> updateGender(String token, String userId, String gender) {
        return Api.getInstance().service
                .updateGender(token,userId,gender)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<String>> updateNickname(String token, String userId, String nickname) {
        return Api.getInstance().service
                .updateNickname(token,userId,nickname)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<String>> updateFace(String token, String userId, RequestBody head) {
        return Api.getInstance().service
                .updateFace(token,userId,head)
                .compose(RxSchedulers.io_main());
    }
}
